﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork2_1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string num = Console.ReadLine();
            int n = int.Parse(num);
            for (int i = 2; i <= n; i++)
            {
                if (n % i != 0)
                    continue;
                bool flag = false;
                int k = 2;
                while (k < Math.Pow(n, 0.5)&&k!=i)
                {
                    if (i % k == 0)
                    {
                        flag = true;
                        break;
                    }
                    k++;
                }
                if (!flag)
                    Console.WriteLine(i);
            }
            Console.ReadKey();//防止退出
        }
    }
}
